<template>
  <div>
    <el-form :inline="true">
      <el-form-item>
        <el-input placeholder="关键字"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button>查询</el-button>
      </el-form-item>
      <el-form-item>
        <el-button>新增</el-button>
      </el-form-item>
    </el-form>

    <el-table
      border
      stripe
      :data="pipelineList">
      <el-table-column sortable prop="id" label="id"/>
      <el-table-column sortable prop="eventFilter" label="eventFilter"/>
      <el-table-column sortable label="sourceDataNodeId">
        <template slot-scope="scope">
          <DataNodeName :dataNodeId="scope.row.sourceDataNodeId"/>
        </template>
      </el-table-column>
      <el-table-column sortable prop="sourceSchema" label="sourceSchema"/>
      <el-table-column sortable prop="sourceTable" label="sourceTable"/>
      <el-table-column sortable label="targetDataNodeId">
        <template slot-scope="scope">
          <DataNodeName :dataNodeId="scope.row.targetDataNodeId"/>
        </template>
      </el-table-column>
      <el-table-column sortable prop="targetSchema" label="targetSchema"/>
      <el-table-column sortable prop="targetTable" label="targetTable"/>
      <el-table-column sortable prop="deletedAt" label="deletedAt"/>
      <el-table-column sortable prop="description" label="description"/>
      <el-table-column label="操作">
        <template slot-scope="scope">
          <FieldMappingLink :pipelineId="scope.row.id"/>
          <a :href="'#/PipelineEdit?id=' + scope.id">修改</a>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import DataNodeName from '@/components/DataNodeName.vue'
import FieldMappingLink from '@/components/FieldMappingLink.vue'

export default {
  components: {
    DataNodeName, FieldMappingLink
  },

  data() {
    return {
      pipelineList : []
    };
  },

  mounted() {
    var _this = this;
    sdk.PipelineApi().list().then(resp=>{
      _this.pipelineList = resp.list;
    });
  }
}
</script>
